
echo "Extension - ${1} - Start";

codesign -f -s "Developer ID Application: Codeux Software, LLC (8482Q6EPL6)" "${SOURCE_FILES_EXTENSIONS}/${1}.bundle"

# *****************************************************
# STANDALONE 
# *****************************************************

mkdir -p "${BUILD_PATH_EXTENSIONS_STANDALONE}"

cp -Rp "${SOURCE_FILES_EXTENSIONS}/${1}.bundle" "${BUILD_PATH_EXTENSIONS_STANDALONE}"

pkgbuild \
--root "${BUILD_PATH}" \
--ownership recommended \
--sign "Developer ID Installer: Codeux Software, LLC (8482Q6EPL6)" \
--quiet \
--identifier "com.codeux.app-extensions.textual-extension-installer-${1}" \
--version "1.0" \
"${PACKAGES_DESTINATION}/STANDALONE/Extension-${1}.pkg"

rm -fr "${BUILD_PATH}"

# *****************************************************
# MAC APP STORE
# *****************************************************

mkdir -p "${BUILD_PATH_EXTENSIONS_MACAPPSTORE}"

cp -Rp "${SOURCE_FILES_EXTENSIONS}/${1}.bundle" "${BUILD_PATH_EXTENSIONS_MACAPPSTORE}"

pkgbuild \
--root "${BUILD_PATH}" \
--ownership recommended \
--sign "Developer ID Installer: Codeux Software, LLC (8482Q6EPL6)" \
--quiet \
--identifier "com.codeux.app-extensions.textual-extension-installer-${1}" \
--version "1.0" \
"${PACKAGES_DESTINATION}/MACAPPSTORE/Extension-${1}.pkg"

rm -fr "${BUILD_PATH}"

# *****************************************************

echo "Extension - ${1} - End";
